<!DOCTYPE html>
<html>
<meta charset="utf-8">
<meta content="IE=9" http-equiv="x-ua-compatible">
<head th:include="include :: header"></head>
<body class="gray-bg">
	<div class="wrapper wrapper-content ">
		<div class="row">
			<div class="col-sm-12">
				<div class="ibox float-e-margins">
					<div class="ibox-content">
						<form class="form-horizontal m-t" id="signupForm">
						<input id="id" name="id" th:value="${goodsSpec.id}"  type="hidden">
							<div class="form-group">	
								<label class="col-sm-2 control-label">规格名称：</label>
								<div class="col-sm-8">
									<input id="name" name="name" th:value="${goodsSpec.name}" class="form-control" type="text">
								</div>
							</div>
							<!--<div class="form-group">-->
								<!--<label for="type" class="col-sm-2 control-label">显示类型</label>-->

								<!--<div class="col-sm-8">-->
									<!--<input type="radio" checked value="0" name="type">文字-->
									<!--<input type="radio" checked value="1" name="type">图片-->
								<!--</div>-->
							<!--</div>-->

							<div class="form-group">
								<label class="col-sm-3 control-label">类型:</label>
								<div class="col-sm-8">
									<label class="radio-inline"> <input
											th:field="*{goodsSpec.type}" type="radio" name="status" value="0" />
										文字
									</label>
									<!--<label class="radio-inline"> <input-->
										<!--th:field="*{goodsSpec.type}" type="radio" name="status" value="1" />-->
									<!--图片-->
									<!--</label>-->
								</div>
							</div>
							<div class="form-group">
								<label for="btnAdd" class="col-sm-2 control-label"></label>

								<div class="col-sm-8">
									<button id="btnAdd" type="button" class="btn btn-primary"><i class="fa fa-plus mr5"></i>添加规格值</button>
								</div>
							</div>
							<div class="form-group">
								<label for="tab" class="col-sm-2 control-label"></label>
								<div class="col-sm-8">
									<table id="tab" width="600" border="0" cellspacing="0" cellpadding="0" >
										<thead>
										<tr align="center">
											<td>规格值名称</td>
											<td width="2"></td>
											<td  style="display: none">规格值别名</td>
											<!--<td width="2"></td>-->
											<!--<td style="display: none">规格图片</td>-->
											<td>操作</td>
										</tr>
										</thead>
										<TBODY>
                                        <tr align="center" th:each="prod : ${specValues}">

                                            <td height="45">
                                                <input type="hidden" name="spec_value_id" th:value="${prod.id}"  value="" />
                                                <input type="text" name="spec_value" th:value="${prod.specValue}" value=""  class="form-control" data-parsley-required="true"></td>
                                            <td width="2"></td>
                                            <td  style="display: none"><input type="text" name="spec_alias" value="" class="form-control"></td><td width="2"></td>

                                            <td th:style="${goodsSpec.type}==0 ? 'display: none'"><button type="button" class="btn btn-default btn-sm mr5">
                                            <img src="<%if(isEmpty(${prod.specPicurl})){%>/img/empty.bmp<%}else{%>${prod.specPicurl}<%}%>" style="height: 20px;width: 20px;">
                                            <input name="spec_picurl" type="hidden" th:value="${prod.specPicurl}" ><i class="ti-upload ml5"></i> </button></td>

                                            <td><i class="up fa fa-arrow-up" style="cursor:pointer;padding: 5px;" title="向上移动"></i>
                                                <i class="down fa fa-arrow-down" style="cursor:pointer;padding: 5px;" title="向下移动"></i>
                                                <i class="del fa fa-remove" style="cursor:pointer;padding: 5px;" title="删除"></i></td>

                                            <!--<td th:text="${prod.nadme}">Onions</td>-->
                                            <!--<td th:text="${prod.price}">2.41</td>-->
                                            <!--<td th:text="${prod.inStock}? #{true} : #{false}">yes</td>-->
                                        </tr>　
										</TBODY>
									</table>
								</div>
							</div>
																					<div class="form-group">
								<div class="col-sm-8 col-sm-offset-3">
									<button type="submit" class="btn btn-primary">提交</button>
								</div>
							</div>
						</form>
					</div>
				</div>
			</div>
	</div>
	</div>
	<div th:include="include::footer"></div>
	<script type="text/javascript" src="/js/appjs/wx/goodsSpec/edit.js">
	</script>
</body>
</html>
